<?php

class Session
{
	static function getParam($name)
	{
		return @$_SESSION[$name];
	} 
	
	static function setParam($name, $value)
	{
		$_SESSION[$name] = $value;
	} 
	
	static
	function
	User()
	{
		static $user = null;
		
		if (is_null($user)) 
		{
			$user = self::getParam('__user__');
		}
		
		if ($user) 
		{
			$user = unserialize($user);
		}
		return $user;
	}
	

    public static function &o()
    {
        static $instance = null;
        if (is_null($instance)) {
            $instance = new self();
        }
        return $instance;
    }

    private function __construct() {}

    public function __clone()
    {
        throw new ArchException('Clone singleton “'.__CLASS__.'” is not allowed');
    }
	
}

?>